DIGITAL INFORMATION - Keyboard Characters & ASCII & HEX

OPENING QUESTION: Please convert the following numbers into binary:

25, 125, 7

Now please convert the following binary numbers into decimal:

11100000, 01010100, 00010000

It's always a good idea to check your work-- here's an example of many different conversions . We'll review tomorrow

REMEMBER, you MUST be able to do binary conversions to decimal and decimal to binary on the test without a converter/calculator.

 

OBJECTIVE:  During today's class I will be able to:

  • convert decimal values into binary values and vice versa
  • relate binary and decimal values to hexadecimals using online tools

WORDS FOR TODAY:

I STRONGLY URGE PLEASE TAKE A FEW MOMENTS TO START A DECK OF FLASH CARDS from the following list:

  • innovation: "A new or improved idea, device, product, etc, or the development thereof
  • prototype: "A proof of concept"
  • CPU: Central Processing Unit
  • Binary: 0's & 1's - Base2
  • Octal: Base8 <no longer required by the AP>
  • Hexadecimal Base16 - 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
  • Byte: one binary 'word'
  • Bit: one binary 'letter' - either a 0 or 1, short for binary digit!

WORK O' THE DAY

Let's revisit yesterdays (brief) conversation of the number of characters on an English keyboard: We know there are upper-case and lower-case letters and then there are numbers. We also know there are a bucket-load of extra characters. However, our keyboards are not always the same. How might we go about determining the 'accepted' number of additional characters?

"How many characters are there on an English language computer keyboard?"

Start with the person designated by the color BLUE and go clockwise around your group-- everyone should guess first.

Then please go counter-clockwise around the group to make a case for your number.

Then please work within your group to come to a consensus.

SOMEONE needs to be Project Manager for the entire class on this one (Not so easy, but I have faith in ya'all). Be patient with each other, this will be a wee bit chaotic.

That's ok.

Really!

That PM, please lead the class in a discussion and work on reaching a consensus number!

Now please take a look an official "ASCII" table that sets the standard for keyboards (Note there is an "extended" character set and that's where things get a wee bit nasty -- we'll ignore that for now)

See what sort of insights we can gain from that and what sorts of things make this topic confusing:

Intro to hexadecimals:

Do you remember the scene in the movie The Martian where our hero is trying to figure out how to communicate with Earth?

Our hero has a difficult problem in that he's trying to use a video camera to "point" to various letters and numbers arrayed in a circle around a video camera.

NASA control can send instructions remotely to his camera to move it.... the bad news was there are 26 alphabetic characters in the English language and 10 numerical digits. That meant he'd have to track 36 movements of the camera. Since it was a circular layout (360 degrees!) that means that he had only 10 degrees of arc for each character, and that just wouldn't work

Let's take a quick gander at that scene

Now let's have a wee bit of fun with that:

 

 

Please write "Hello World!" as a hexadecimal message. Generally speaking, coders usually group hexadecimal code into groups of 2 digits separated by spaces

Notice that there are execution commands available too... many of us have never scene a typewriter, let alone a MANUAL (not electric) typewriter. But let's imagine we were sending our "Hello World!" msg to an electronic printer and we wanted that printer to execute a 'carriage return' and a 'line feed' upon printing that msg.

    • What would we add to our code?
    • What would the printer do?

═══════════════════════════

This is jumping ahead a wee bit, but take a gander at THIS REALLY cool tool that allows us to look at source code in HEX.

If we go back to that scene in the Martian and jump to the very end, we can view the instance where our hero actually hacks the operating system of his rover USING HEX (that's real world stuff!). Please open that scene and report out the time stamp for that instance!

Why would low-level hacks be SOOOO much easier in hex?

Here's another quick writing exercise:

Please answer the following question *thoughtfully*:

Why do computer/programming jockeys prefer to write low-level commands in hex rather than binary?

  1. Now let's take a gander at THIS cool Code.Org widget...
  • What is the largest binary number that will fit?

  • What is the largest hex number that will fit?

  • What happens to those values when we exceed the number of digits available?

═══════════════════════════